	/*var backurl = request("backurl");
	var channel = request("channel");
	var uid = request("uid");
	var userName=request("productCode");
	var currentImg = 1;
	  function changeImg()
	  {
	     var index = (currentImg)%3+1;
	     $("#imgReg").attr("src","img/zc"+index+".jpg");
	     currentImg = index;
	  }
	$(document).ready(function()
	{
	    setInterval("changeImg()", 3000);
	    $("#loginHtml").attr("href","logon.html?channel="+channel+"&backurl="+backurl);
	    $("#errorLink").attr("href","GetPass.html?channel="+channel+"&backurl="+backurl);
	    $("#newPass").focus(function(){
	       $("#newPass_error").hide();
	       $("#newPass_tip").show();
	    });
	    $("#newPass").blur(function(){
	       $("#newPass_tip").hide();
	          validatePassword(true,$("#newPass"),$("#newPass_error"));
	    });
	    $("#rPass").focus(function(){
	       $("#rPass_error").hide();
	       $("#rPass_tip").show();
	    });
	    $("#rPass").blur(function(){
	       $("#rPass_tip").hide();
	          validateRePassword(true,$("#newPass"),$("#rPass"),$("#rPass_error"));
	    });
	        
  });*/
  function sumbitPass()
  {
     var validateOK = true;
     var nPass = $("#newPass").val();
     var rPass = $("#rPass").val();
     $("#submitNow").attr("href","javascript:void(0);");
     if(!validatePassword(false,$("#newPass"),$("#newPass_error")))
     {
        validateOK = false;
     }
     if(!validateRePassword(false,$("#newPass"),$("#rPass"),$("#rPass_error")))
     {
        validateOK = false;
     }
     if(!validateOK)
     {
        $("#submitNow").attr("href","javascript:sumbitPass();");
        return;
     }
     var param = {
         "password": nPass,
         "yPass":$("#YPass").val()
     }
     serviceRequest("/carData/rest",param,function(data) {

        if("0000" == data.Status){
        	  //aftrChangeLogon(userName,nPass);
        	  /*if ( null == backurl || "undefined" == backurl){
        	  	backurl = "";
        	  }
        	  if ( null == channel || "undefined" == channel){
        	  	channel = "";
        	  }*/
        	  /*var url = 'localhost:8083?channel='+channel+'&backurl='+backurl+'&v=20130718';*/
        	  top.location.href="http://localhost:8083/"
        	  /*setTimeout(function(){toUrl(url)},1000);*/
           return;
        }

     },function(){
         $("#newPass_error").html("系统繁忙，请稍后再试").show();
         reset();
         $("#submitNow").attr("href","javascript:sumbitPass();");
         return;
     });
  }
  
  function aftrChangeLogon(userName,nPass)
  {
	  serviceRequest("user/logonauto",{msisdn : userName,ps : nPass,cId : channel,backurl : backurl},function(data) 
	           {
          var rs = data ;
          var reCode = rs.flag;
          var rurl = backurl ;
          //先判断地址栏里是否存在返回地址
          if(null == rurl || undefined == rurl || "" == rurl || rurl.length < 1)
          {
             rurl = "http://js.ac.10086.cn/jsauth/";
          }
          var key = rs.key;
          if("0000" == reCode)
          {
             $.each(rs.keys,function(index,value){
                goUrl(value.cId,key,value.cKey,value.crl);
             });
          }
          return;
      },function(){
          return;
      });
	}
	
	//进行跳转
    function goUrl(cId,key,sign,baseurl)
    {
       var ifr = document.createElement("iframe"); 
       ifr.id = cId;
       ifr.name= cId;
       var sc = baseurl + "?sc="  + key + "&channel=" + cId + "&sign=" + sign;
       ifr.src = sc; 
       ifr.border = "0";
       ifr.style.display = "none";
       document.body.appendChild(ifr);
    }
    
    function toUrl(url)
    {

        window.parent.open(url,'_self')
 	    /*window.location.href=url;*/
 	}
 	
    function reset()
    {
       $("#newPass").val("");
       $("#rPass").val("");
       $("#newPass_error").hide();
    }
	     
  //校验密码
  function validatePassword(flag,$password,$error)
  {
       var password = $password.val();
       if(password == null || password.length <= 0 )
       {
           if(!flag)
           {
               $error.html("密码不可为空").show();
           }
		   return false;
       }
       /*if(!validatePasswordFormat(password))
       {
           $error.html("密码格式不正确，请重新输入").show();
		   return false;       
       }*/
       return true;
  }
  
  
    //二次密码校验
    function  validateRePassword(flag,$password,$repassword,$error)
    {
       var password1 = $password.val();
       var password2 = $repassword.val(); 
      
       if(password2 == '' || password2.length <= 0)
       {
           if(!flag){
              $error.html("密码不可为空").show();
           }
		   return false;
       }
       if(password1 != password2)
       {
         $error.html("两次密码不一致,请重新输入").show();
		 return false;
       }
       else
       {
         $error.html("").show();
         return true;
       }
    }



function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);//search,查询？后面的参数，并匹配正则
    if (r != null) return unescape(r[2]);
    return null;
}
